<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Page extends Controller_Common {

	public $template='layout/index';

	public function action_one() {
		$page = ORM::factory('Pages')->getOne($this->postfix, $this->request->param('id'));

		if (!empty($page)) {
			$this->buildCarcas();
			$this->template->title .= ' - '.$page->title;

			$this->template->content = View::factory('pages/page', array(
				'page' => $page,
			));
		} else {
			throw HTTP_Exception::factory(404, ':text', array(
				':text' => $this->sitetext['not_found']['_value']
			));
		}

	}
}